package com.dao;

import com.entity.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by Administrator on 2018/10/20.
 */
public interface SelectFormDao {
    //查询课程表
    List<Subject> subjectList();

    //查询地区表
    List<Location> locationList(@Param("cityId") Integer cityId);

    //查询城市表
    List<City> cityList();

    //查询定位城市是否存在
    Integer findCityIsBeing(@Param("cityName") String cityName);

    //查询学校表
    List<School> schoolList(@Param("cityId") Integer cityId);

    //查询专业表
    List<Major> majorList();

    //查询籍贯表
    List<BirthPlace> birthPlaceList();

    //修改认证
    int TeacherIdentifyUpdata(@Param("userid") String userId, @Param("path") String filePath, @Param("position") Integer position);

    //查看认证信息
    String findTeacherIdentify(@Param("userid") String userid);

    //查是否预约申请
    int selectRecord(@Param("stdUserId") Integer stdUserId, @Param("stdId") Integer stdId, @Param("teaUserId") Integer teaUserId, @Param("teaId") Integer teaId);

    int selectRecord2(@Param("stdUserId") Integer stdUserId, @Param("stdId") Integer stdId, @Param("teaUserId") Integer teaUserId, @Param("teaId") Integer teaId);

    //预约或者申请增加
    int insertRecord(@Param("stduserid") String stdUserId, @Param("teauserid") String TeaUserId, @Param("uuid") String UUID, @Param("stdid") String stdId, @Param("teaid") String teaId, @Param("recordType") String recordType);

    //取消订单
    int updateRecord(@Param("recordId") Integer recordId);

    //查询关联的教师表
    List<Teacher> findRecordTeacher(@Param("userid") String userId, @Param("limit") int limit);

    //查询关联的学生表
    List<AssociationInfo> findRecordStudent(@Param("userid") String userId, @Param("limit") int limit, @Param("tp") String tp);

    //上传头像
    int upPhoto(@Param("userid") String userId, @Param("url") String url);

    List<AssociationInfo> findMyAppointment(@Param("userId") Integer userId, @Param("limit") Integer limit);

    List<AssociationInfo> findApplied(@Param("userId") Integer userId, @Param("limit") Integer limit);

    List<AssociationInfo> findMyPublishAppointment(@Param("userId") Integer userId, @Param("id") Integer id, @Param("limit") Integer limit);

    //新增FormId
    int insertFormId(@Param("userId") String userId, @Param("formId") String formId, @Param("startTime") String startTime, @Param("endTime") String endTime);

    //修改FormId
    int updateFormId(@Param("id") Integer id);

    int updateOtherFormId(@Param("otherUserId") String otherUserId, @Param("otherFormId") String otherFormId);

    //查openID
    String findOpenId(@Param("userid") String userId);

    //查询FOrmId
    List<formIdInfo> selectOhterFormId(@Param("userId") String userId);

    //插入openid
    int insertOpenId(@Param("userid") String userId, @Param("openid") String openid);

    String findRecordStatus(@Param("recordId") String RecordId);

    BigDecimal findMoney(@Param("userId") String userId);

    int addMoney(@Param("money") BigDecimal bigDecimal, @Param("userId") String userId);

    int saveMap(@Param("recordId") Integer recordId, @Param("thisLocation") String thisLocation, @Param("aimLocation") String aimLocation, @Param("mapPath") String mapPath);

    int findPathCount(@Param("recordId") Integer recordId);

    int savePath(@Param("recordId") Integer recordId, @Param("thisLocation") String thisLocation, @Param("thisLat") String thisLat, @Param("thisLog") String thisLog, @Param("aimLocation") String aimLocation, @Param("aimLat") String aimLat, @Param("aimLog") String aimLog);
}
